package com.wdog5.tutorial;

import org.bukkit.entity.Player;

import java.util.HashMap;
import java.util.UUID;

public class BankStorage {

    public static HashMap<UUID, Integer> playerBank = new HashMap<>();

    public int getMoney(Player player) {
        return playerBank.get(player.getUniqueId());
    }

    public void addMoney(Player player, int value) {
        playerBank.put(player.getUniqueId(), value);
    }

    public void removeMoney(Player player, int value) {
        playerBank.remove(player.getUniqueId(), value);
    }

    public void addPlayer(Player player) {
        addMoney(player, 0);
    }

    public void removePlayerByUUID(UUID uuid, int value) {
        playerBank.remove(uuid, value);
    }

    public void addPlayerByUUID(UUID uuid, int value) {
        playerBank.put(uuid, value);
    }
    public void resetBank() {
        playerBank.clear();
    }
}
